package foodmaterial.dao;

import foodmaterial.dto.*;
import foodmaterial.entity.*;
import org.apache.ibatis.annotations.Mapper;

import java.util.List;
import java.util.Map;

@Mapper
public interface FoodMaterialDao {
    int insertFoodMaterialType(FoodMaterialType foodMaterialType) ;
    int updateFoodMaterialType(FoodMaterialType foodMaterialType) ;
    List<FoodMaterialType> selectFoodMaterialType(FoodMaterialTypeDto dto) ;

    int insertFoodMaterialUnit(FoodMaterialUnit foodMaterialUnit) ;
    int updateFoodMaterialUnit(FoodMaterialUnit foodMaterialUnit) ;
    List<FoodMaterialUnit> selectFoodMaterialUnit(FoodMaterialUnit foodMaterialUnit) ;

    int insertFoodMaterial(FoodMaterial foodMaterial) ;
    int batchInsertFoodMaterial(List<FoodMaterial> list) ;
    int updateFoodMaterial(FoodMaterial foodMaterial) ;
    int stopFoodMaterial(Map<String,Object> params) ;
    int batchUpdateFoodMaterialPrice(List<FoodMaterial> foodMaterials);//批量更新价格
    int updateFoodMaterialStock(List<FoodMaterial> foodMaterials) ;//修改食材的库存
    int updateFoodMaterialBuyPriceAndStock(List<FoodMaterial> foodMaterials) ; //修改食材最后的买入价格和库存
    int updateOriginalProcessRate(List<FoodMaterial> foodMaterials) ; //修改食材的毛净转化率
    List<FoodMaterial> selectFoodMaterial(FoodMaterialDto dto) ;
    List<FoodMaterial> selectOriginalFoodMaterial(FoodMaterialDto dto) ;
    //给采购单查询食材，修改库存和进货价
    List<FoodMaterial> selectFoodMaterialByIds(List<PurchaseBillDetails> ids) ;
    List<FoodMaterial> selectSupplyFoodMaterial(FoodMaterialDto dto) ;//获取某天供应食材
    //不看供应，给公司为vip排餐使用
    List<FoodMaterial> selectVipFoodMaterial(FoodMaterialDto dto) ;//获取vip的食材
    List<FoodMaterial> selectVipSupplyFoodMaterial(FoodMaterialDto dto) ;//自下vip获取某天供应价格

    List<FoodMaterialSupply> checkFoodMaterialSupply(FoodMaterialSupplyDto dto) ;
    int checkFoodMaterialSupplyCount(FoodMaterialSupplyDto dto) ;
    int insertFoodMaterialSupply(List<FoodMaterialSupply> list) ;
    int deleteFoodMaterialSupply(FoodMaterialSupplyDto dto) ;
    List<FoodMaterialSupply> selectFoodMaterialSupply(FoodMaterialSupplyDto dto) ;

    int insertCustomerPriceTemplate(CustomerPriceTemplate customerPriceTemplate) ;
    int insertCustomerPriceTemplateDetail(List<CustomerPriceTemplateDetail> details) ;
    int updateCustomerPriceTemplate(CustomerPriceTemplate customerPriceTemplate) ;
    int deleteCustomerPriceTemplate(Long templateId) ;
    int deleteCustomerPriceTemplateDetail(Long templateId) ;
    List<CustomerPriceTemplate> selectCustomerPriceTemplate(CustomerPriceTemplate template) ;
    List<CustomerPriceTemplateDetail> selectCustomerPriceTemplateDetail(CustomerPriceTemplateDetailDto dto) ;
    //vip订单调整价格使用
    List<CustomerPriceTemplateDetail> selectCustomerPriceDetail(foodmaterial.dto.CustomerPriceDto dto);

    int insertCustomerPrice(List<CustomerPrice> customerPrices) ;
    int deleteCustomerPrice(CustomerPriceDto dto) ;
    List<CustomerPrice> selectCustomerPrice(CustomerPriceDto dto) ;

    int checkFoodMaterial() ;

    void truncateFoodMaterial() ;

    void truncateFoodMaterialType() ;

    int insertTestReport(TestReport testReport) ;
    int updateTestReport(TestReport testReport) ;
    int deleteTestReport(Long id) ;
    List<TestReport> selectTestReport(TestReportDto dto) ;
}
